package com.pomr.model.sys;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.pomr.model.equipmentstorage.MonitoringData;

/**
 * 类名称： Effect
 * 创建人： Administrator
 * 创建时间：2018年6月11日 下午6:23:42
 * 类描述：功能菜单
 */
@Table(name="effect")
@Entity
public class Effect implements Serializable{
	
	public String getIco() {
		return ico;
	}

	public void setIco(String ico) {
		this.ico = ico;
	}

	public Set<Effect> getChilds() {
		return childs;
	}

	public void setChilds(Set<Effect> childs) {
		this.childs = childs;
	}



	private static final long serialVersionUID = 1L;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "native")
    @GenericGenerator(name = "native", strategy = "native")//AUTO 在mysql中需要指定使用本地策略生成主键值
	private Integer id;
	
	@Column(name="title", length=20)
	private String title;//功能名称
	
	@Column(name="url", length=100)
	private String url;//url地址
	
	@Column(name="ico", length=10)
	private String ico;//图表代码
	
	@OneToMany(fetch=FetchType.LAZY, cascade=CascadeType.REMOVE,targetEntity = Effect.class,orphanRemoval = true)
	@JoinColumn(name="patient_id")
	private Set<Effect> childs;

	@Column(name="status")
	private Integer status;//状态 -1 权限失效

}
